package com.android.billingclient.api;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import c.a.a.a.a;

final class h0 extends BroadcastReceiver {
    /* access modifiers changed from: private */

    /* renamed from: a  reason: collision with root package name */
    public final k f2063a;

    /* renamed from: b  reason: collision with root package name */
    private boolean f2064b;

    /* renamed from: c  reason: collision with root package name */
    private final /* synthetic */ g0 f2065c;

    private h0(g0 g0Var, k kVar) {
        this.f2065c = g0Var;
        this.f2063a = kVar;
    }

    public final void b(Context context) {
        if (this.f2064b) {
            context.unregisterReceiver(this.f2065c.f2058b);
            this.f2064b = false;
            return;
        }
        a.k("BillingBroadcastManager", "Receiver is not registered.");
    }

    public final void c(Context context, IntentFilter intentFilter) {
        if (!this.f2064b) {
            context.registerReceiver(this.f2065c.f2058b, intentFilter);
            this.f2064b = true;
        }
    }

    public final void onReceive(Context context, Intent intent) {
        this.f2063a.a(a.f(intent, "BillingBroadcastManager"), a.e(intent.getExtras()));
    }
}
